<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>上传附件</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style type="text/css">
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: black;
            height: 39px;
        }

        .table-detail-payee:nth-child(even) td.td-title {
            background-color: white;
            height: 39px;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .span-btn {
            position: absolute;
            left: 10px;
            margin-top: 4px;
            cursor: pointer;
        }

        .auditorName {
            text-align: center;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            /*vertical-align: middle;*/
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
        }

        .progressobj {
            height: 20px;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .select {
            color: #fff;
            background-color: #045B9E;
        }

        td .sp-value {
            display: inline-block;
            padding-left: 6px;
            word-wrap: break-word;
        }

        td {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
            font-weight: normal !important;
            width: 255px;
            height: 39px !important;
        }

        .table-detail-payee:nth-child(even) td.td-title {
            background-color: white;
            height: 39px !important;
        }

        .printDiv {
            display: none;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            border-radius: 4px;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        #divUploadedFiles {
            /*padding: 4px;*/
            padding-bottom: 0;
        }

        .biTian {
            position: absolute;
            color: red;
            margin-left: 0px;
            margin-top: 2px;
        }

        .th-title {
            text-align: left !important;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>

<section class="content" id="app">
    <table class="table table-bordered text-center" style="table-layout: auto;">
        <tr>
            <td class="td-title" colspan="2">发票</td>
        </tr>
        <tr>
            <td class="td-row2 td-value1">
                <div id="divUploadedFiles">
                    <div class="fj-tanzhongStyle " v-for="(attach,i) in contract.invoice"
                         v-if="attach.name!=''">
                        <b :class="fjStyle(attach.name)"></b>
                        <div class="name" v-if="attach.name" :title="attach.name"
                             v-on:click="download(attach.url,attach.name)">{{attach.name}}
                        </div>
                        <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                             v-on:click="download(attach.url,attach.name)">下载</a></div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/apply/tmpevent/class.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;

    var app = new Vue({
            el: "#app",
            data: {
                contract: {
                    contractId: $.wyui.page.urlParams.contractId ? $.wyui.page.urlParams.contractId : '',
                    invoice: [{name: '', url: ''}],
                },
            },
            methods: {
                fjStyle: function (fjName) {
                    if (fjName) {
                        var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                        return 'img fj-' + type
                    }
                    return 'img'
                },
                deleteFile: function (i) {
                    this.contract.attaches.splice(i, 1);
                },
                download: function (attachId, fileName) {
                    downloadFile(attachId,fileName)
                    return false;
                }
            },

            mounted: function () {
                //页面操作状态
                this.contractId = $.wyui.page.urlParams.contractId;
                //上传附件
                var that = this;
                $.wyui.postMethod("/receivable/getUploadFileByContractId.json", {contractId: that.contract.contractId}, function (data) {
                    that.contract.invoice = data.invoice;
                });

            }
        })
    ;

</script>
</body>
</html>